package com.deluxelx.rmo.common.enums;

import java.util.Objects;

public enum GenderCode {

    FEMALE((short) 0, "female"),
    MALE((short) 1, "male"),
    DEFAULT((short) -1, "default");

    private final Short code;

    private final String info;

    GenderCode(Short code, String info) {
        this.code = code;
        this.info = info;
    }

    public Short getCode() {
        return code;
    }

    public String getInfo() {
        return info;
    }

    public static String getInfoByCode(Short code) {
        if (Objects.equals(code, FEMALE.code)) {
            return FEMALE.info;
        } else if (Objects.equals(code, MALE.code)) {
            return MALE.info;
        } else {
            return DEFAULT.info;
        }
    }

}
